home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261a.zoo / gcc-lib / op_vnew.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-20  |  694 b   |  33 lines

  1. /* void * operator new [] (size_t), described in 17.3.3.6.  This function
  2.    is used by C++ programs to allocate a block of memory for an array.  */
  3.  
  4. #include <types.h>
  5.  
  6. extern void * __builtin_new (size_t);
  7.  
  8. void *
  9. __builtin_vec_new (size_t sz)
  10. {
  11.   return __builtin_new (sz);
  12. }
  13.  
  14. /* operator delete [] (void *), described in 17.3.3.4.  This function is
  15.    used by C++ programs to return to the free store a block of memory
  16.    allocated as an array. */
  17.  
  18. extern void __builtin_delete (void *);
  19.  
  20. void
  21. __builtin_vec_delete (void *ptr)
  22. {
  23.   __builtin_delete (ptr);
  24. }
  25.  
  26. #define MESSAGE "pure virtual method called\n"
  27. void
  28. __pure_virtual ()
  29. {
  30.   write (2, MESSAGE, sizeof (MESSAGE) - 1);
  31.   _exit (-1);
  32. }
  33.